import React, { useRef } from 'react';
// @ts-ignore
import { Form, Input, Button } from 'abc-ui';

const layout = {
  labelCol: { span: 6 },
  wrapperCol: { span: 16 },
};
const tailLayout = {
  wrapperCol: { offset: 6, span: 16 },
};
export default () => {
  const formRef = useRef(null);
  const submit = () => {
    // @ts-ignore
    console.log(formRef.current.getFieldsValue());
  };
  return (
    <div>
      <Form
        formRef={formRef}
        name="basic"
        initialValues={{ username: 'nihao' }}
      >
        <Form.Item {...layout} label="用户名" name="username">
          <Input />
        </Form.Item>

        <Form.Item {...layout} label="密码" name="password">
          <Input />
        </Form.Item>
        <Form.Item {...tailLayout}>
          <Button btnType="primary" onClick={submit}>
            提交
          </Button>
        </Form.Item>
      </Form>
    </div>
  );
};
